package com.huawei.hwCloudJs.service.hms;

import android.app.PendingIntent;
import android.content.Intent;
import android.os.Parcelable;
import java.util.HashMap;
import java.util.Map;

public class d {
    private static final d a = new d();
    private final Map<String, Parcelable> b = new HashMap();

    public static d a() {
        return a;
    }

    public Intent a(String str) {
        synchronized (this.b) {
            Parcelable parcelable = (Parcelable) this.b.get(str);
            if (parcelable instanceof Intent) {
                Intent intent = (Intent) parcelable;
                return intent;
            }
            return null;
        }
    }

    public void a(String str, PendingIntent pendingIntent) {
        synchronized (this.b) {
            this.b.put(str, pendingIntent);
        }
    }

    public void a(String str, Intent intent) {
        synchronized (this.b) {
            this.b.put(str, intent);
        }
    }

    public PendingIntent b(String str) {
        synchronized (this.b) {
            Parcelable parcelable = (Parcelable) this.b.get(str);
            if (parcelable instanceof PendingIntent) {
                PendingIntent pendingIntent = (PendingIntent) parcelable;
                return pendingIntent;
            }
            return null;
        }
    }
}
